<%-- 
    Document   : searchProduct
    Created on : Jun 29, 2012, 1:09:58 PM
    Author     : Owner
--%>

<%@include file="/jsp/top.jsp"%>

<html>
    <head>        
        <title>Search Result</title>
        <script type="text/javascript">
            $(document).ready(function(){
                $('#1').hide();
                $('#2').hide();
                $('#3').hide();
                $('#4').hide();
                $("#thechoices").change(function(){
                    $("#" + this.value).show().siblings().hide();
                });

                $("#thechoices").change();
            });
        </script>
    </head>
    <body>
        <div class="clear"></div>
        <table cellspacing="5px" width="100%" align="center">
            <tr>
                <td>
                    <table cellspacing="5px" width="100%" align="center">
                        <tr>
                            <td style="vertical-align: top;" width="20%">
                                <%@include file="/jsp/right.jsp" %></td>
                            <td style="vertical-align: top;" width="80%">
                                <table align="center" border="1" cellspacing="10px" width="100%">
                                    <tr>
                                        <td>
                                            <div class="page-title"><h1>Advanced Search</h1></div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <html:form action="/product" method="post">
                                                <table cellspacing="10px" align="center" width="100%">
                                                    <tr>
                                                        <td colspan="5">
                                                            <div id="errdividas" >
                                                                <span id="errspanidas"></span>
                                                                <html:errors property="errAdvancedSearch"/>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="20%">
                                                            <h2>Search Criteria</h2>                                                            
                                                        </td>
                                                        <td align="left" width="30%">
                                                            <html:select property="searchCriteria" styleId="thechoices" style="width:150px;">
                                                                <html:option value="1">Keyword</html:option>
                                                                <html:option value="2">Character</html:option>
                                                                <html:option value="3">Brands</html:option>
                                                                <html:option value="4">Category</html:option>
                                                                <html:option value="5">Price</html:option>
                                                            </html:select>
                                                        </td>
                                                        <td width="30%">
                                                            <div id="boxes">
                                                                <div id="1">
                                                                    <html:text property="product"/>
                                                                </div>
                                                                <div id="2">
                                                                    <html:select property="productName" style="width:80px;">
                                                                        <html:option value="All">All</html:option>
                                                                        <html:option value="A">A</html:option><html:option value="B">B</html:option><html:option value="C">C</html:option><html:option value="D">D</html:option><html:option value="E">E</html:option><html:option value="F">F</html:option>
                                                                        <html:option value="G">G</html:option><html:option value="H">H</html:option><html:option value="I">I</html:option><html:option value="J">J</html:option><html:option value="K">K</html:option><html:option value="L">L</html:option>
                                                                        <html:option value="M">M</html:option><html:option value="N">N</html:option><html:option value="O">O</html:option><html:option value="P">P</html:option><html:option value="Q">Q</html:option><html:option value="R">R</html:option>
                                                                        <html:option value="S">S</html:option><html:option value="T">T</html:option><html:option value="U">U</html:option><html:option value="V">V</html:option><html:option value="W">W</html:option><html:option value="X">X</html:option>
                                                                        <html:option value="Y">Y</html:option><html:option value="Z">Z</html:option><html:option value="0">0</html:option><html:option value="1">1</html:option><html:option value="2">2</html:option><html:option value="3">3</html:option>
                                                                        <html:option value="4">4</html:option><html:option value="5">5</html:option><html:option value="6">6</html:option><html:option value="7">7</html:option><html:option value="8">8</html:option><html:option value="9">9</html:option>
                                                                    </html:select>
                                                                </div>
                                                                <div id="3">
                                                                    <html:select property="productBrandId">
                                                                        <html:option value="0">--Select Brand--</html:option>
                                                                        <html:options collection="brandMap" property="key" labelProperty="value"/>
                                                                    </html:select>
                                                                </div>
                                                                <div id="4">
                                                                    <html:select property="productCategoryId">
                                                                        <html:option value="0">--Select Category--</html:option>
                                                                        <html:options collection="mainCategoryMap" property="key" labelProperty="value"/>
                                                                    </html:select>
                                                                </div>
                                                                <div id="5">
                                                                    <strong>Min :</strong><html:text property="minPrice"/>&nbsp;<strong>Max:</strong><html:text property="maxPrice"/>
                                                                </div>
                                                            </div>
                                                        </td>
                                                        <td width="20%" style="vertical-align: top;">
                                                            <a onclick="javascript:return advSearch('./product.do?action=advancedSearch','ProductBean')">
                                                                <img alt="Find" src="images/find.png" onmouseout="src='images/find.png'" onmouseover="src='images/find-hover.png'"/>
                                                            </a>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </html:form>
                                        </td>
                                    </tr>
                                    <logic:notPresent name="productList" scope="request">
                                        <logic:empty name="productList" scope="request">
                                            <tr>
                                                <td>
                                                    Your Search Criteria: <br/>
                                                    <logic:present name="searchCriteria" scope="request">
                                                        <strong>Search By: </strong><bean:write name="searchCriteria" scope="request"/>
                                                    </logic:present>
                                                    <logic:present name="searchValue" scope="request">
                                                        <strong>Value: </strong><bean:write name="searchValue" scope="request"/>
                                                    </logic:present>
                                                    <br/>
                                                    No Products found for your search criteria.
                                                </td>
                                            </tr>
                                        </logic:empty>
                                        <logic:notEmpty name="productList" scope="request">
                                            <tr>
                                                <td>Enter your search criteria for searching product</td>
                                            </tr>
                                        </logic:notEmpty>
                                    </logic:notPresent>
                                    <logic:present name="productList" scope="request">
                                        <logic:empty name="productList" scope="request">
                                            <tr>
                                                <td>
                                                    Your Search Criteria: <br/>
                                                    <logic:present name="searchCriteria" scope="request">
                                                        <strong>Search By: </strong><bean:write name="searchCriteria" scope="request"/>
                                                    </logic:present>
                                                    <logic:present name="searchValue" scope="request">
                                                        <strong>Value: </strong><bean:write name="searchValue" scope="request"/>
                                                    </logic:present>
                                                    No Products found for your search criteria.
                                                </td>
                                            </tr>
                                        </logic:empty>
                                        <logic:notEmpty name="productList" scope="request">
                                            <tr>
                                                <td>
                                                    Your Search Criteria: <br/>
                                                    <logic:present name="searchCriteria" scope="request">
                                                        <strong>Search By: </strong><bean:write name="searchCriteria" scope="request"/>
                                                    </logic:present>
                                                    <logic:present name="searchValue" scope="request">
                                                        <strong>Value: </strong><bean:write name="searchValue" scope="request"/>
                                                    </logic:present>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <div style="float: left; width: 100%"  id="page_container" >
                                                        <div align="center" class="page_navigation"></div>
                                                        <ul class="content">

                                                            <logic:iterate id="products" name="productList" scope="request">
                                                                <li>
                                                                    <div style="float: left;width: 250px; height: 325px;">
                                                                        <ul style="text-align: center">
                                                                            <li style="height: 155px;">
                                                                                <a href="./product.do?action=showProductDetails&productId=<bean:write name="products" property="productId"/>&productName=<bean:write name="products" property="productName"/>">
                                                                                    <img alt="<bean:write name="products" property="productName"/>" src="products/<bean:write name="products" property="productSmallImageName"/>" width="150px" height="150px"/></a>
                                                                            </li>
                                                                            <li style="height: 45px;">
                                                                                <a href="./product.do?action=showProductDetails&productId=<bean:write name="products" property="productId"/>&productName=<bean:write name="products" property="productName"/>">
                                                                                    <bean:write name="products" property="productName"/></a>
                                                                            </li>
                                                                            <li>
                                                                                Rs. <bean:write name="products" property="productPrice"/>
                                                                            </li>
                                                                            <li>
                                                                                <a href="./product.do?action=addToCart&direct=1&productId=<bean:write name="products" property="productId"/>"><%--&productName=<bean:write name="products" property="productName"/>">--%>
                                                                                    <img alt="Buy Now" src="images/buynow.png"/></a><br/>
                                                                                <a href="./product.do?action=showWishList&productId=<bean:write name="products" property="productId"/>&productName=<bean:write name="products" property="productName"/>">Add to WishList</a>
                                                                            </li>
                                                                        </ul>
                                                                    </div>
                                                                </li>
                                                            </logic:iterate>
                                                        </ul>
                                                    </div>
                                                </td>
                                            </tr>
                                        </logic:notEmpty>
                                    </logic:present>

                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td><%@include file="/jsp/footer.jsp" %></td>
            </tr>
        </table>
    </body>
</html>
